﻿package framework.core;

import java.util.HashMap;
import java.util.Map;

import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.lib.GSSystemConfigurator;
import com.hitrust.gs.service.GSBaseManager;


public class ConstDefine 
{
    //超级管理员定义 
    public static final String T_USER_SUPERADMIN_ID = "599BD53F87B44F56AA51DB4B155A657C";
    public static final String T_USER_SUPERADMIN_CODE = "superadmin";
    //视图切换
    public static final int VIEW_SWITCH_TOP=9000;
    public static final int VIEW_SWITCH=9001;
    
    //巴士物资定义
    public static final String T_WARE_HOUSE_CODE="00";
    public static final String T_WAREE_HOUSE_NAME=GSBaseManager.getWareHoseNameByCode(T_WARE_HOUSE_CODE);
    
	public static final int YES = 1 ;
	public static final int NO = 0 ;
	public static final String STR_YES = "1" ;	
	public static final String STR_NAME_YES = "是" ;
	public static final String STR_NO = "0" ;  
	public static final String STR_NAME_NO = "否" ;	
	
	//审核状态
    public static final String AUDITING_YES = "2";
    public static final String AUDITING_YES_NAME = "已通过";
    public static final String AUDITING_NO = "3";
    public static final String AUDITING_NO_NAME = "未通过"; 
    public static final String AUDITING_MODIFY = "1";
    public static final String AUDITING_MODIFY_NAME = "待修改";
    public static final String AUDITING_NOT = "0";
    public static final String AUDITING_NOT_NAME = "未审核"; 
	// 数据类型定义
	public static final String STR_VAL_DEAL = "1";
	public static final String STR_NAME_DEAL = "交易平台导入";
	public static final String STR_VAL_HAND = "0";
	public static final String STR_NAME_HAND = "手工录入";
	
	public static final String STR_ALL = "";
	public static final String STR_ALL_NAME = "--全部--";
	
	public static final String STR_IN = "1";    
	public static final String STR_NAME_IN = "入库";
	public static final String STR_OUT = "2";
	public static final String STR_NAME_OUT = "出库";
	
	//oracle外键异常code
	public static final int ORACEL_FK_ERROR_CODE = 2292 ;
	
	// add by chengbiao.he start
	
	public static final String STR_YK = "1";
	public static final String STR_NAME_YK = "压库";
	public static final String STR_MD = "2";
	public static final String STR_NAME_MD = "买断";
	public static final String WAREHOUSE_CATEGORY_TOP = "0";
	public static final String WAREHOUSE_CATEGORY_TOP_NAME = "顶级分类";
	
	
	// add by chengbiao.he end

	// add by Jackey start
	
	//菜单类型
	public static final String MENUINFO_PARENT_CODE_MAIN = "0";
	public static final String MENUINFO_PARENT_CODE_MAIN_NAME = "主菜单";
	public static final String MENUINFO_SHOW_TYPE_MAIN = "0";
	public static final String MENUINFO_SHOW_TYPE_MAIN_NAME = "管理菜单";
	
	//============Excel文件操作 Start ===============//
	//获取数据类型
    public static final String EXCELFILE_LOAD_TYPE_FULL = "full";   //全部数据
    public static final String EXCELFILE_LOAD_TYPE_TIME = "time";   //大于时间参数的数据
	
    //创建Excel文件错误
    public static final String EXCELFILE_CREATE_ERROR = "error"; 
    
    //生成Excel文件保存路径
    public static final String EXCELFILE_SAVECREATEFILE_PATH = "back\\file\\down\\";
    //生成文件下载路径　
    public static final String EXCELFILE_DOWNLOADCREATEFILE_PATH = "/back/file/down/";
    
    //上传Excel文件保存路径
    public static final String EXCELFILE_SAVEUPLOADFILE_PATH = "back\\file\\upload\\"; 
    public static final String EXCELFILE_SERVERUOLOADFILE_PATH = "/back/file/upload/";
    
    //上传迎世博600天车辆整改文件保存路径
    public static final String EXCELFILE_WROLDEXPROLOR_SAVEPATH = "back\\file\\WorldExproler\\";
    
    //系统生成Excel文件用户帐号
    public static final String EXCELFILE_CREATE_USER_ID_AUTO = "07A185148AA041FB88843954FBF5DC70";
    public static final String EXCELFILE_CREATE_USER_AUTO = "auto";
    
    public static final String CUSTOMER_HEAD_ID = "1AB2C360D8145E007413FC7480A1BB1G";
    public static final String CUSTOMER_HEAD_CODE = "00";
    
    //============Excel文件操作 End ===============//
    
	// add by Jackey end
	
	// add by wing start
    
    public static final String STR_VALID_YES = "1" ;
	public static final String STR_NAME_VALID_YES = "有效" ;
	public static final String STR_VALID_NO = "0" ;
    public static final String STR_NAME_VALID_NO = "无效" ;
    
    public static final String STR_MALE = "1" ;
    public static final String STR_NAME_MALE = "男" ;
    public static final String STR_FEMALE = "0" ;
    public static final String STR_NAME_FEMALE = "女" ;
    
    public static final String DULL_STORAGE_TIME_60 = "60";
    public static final String DULL_STORAGE_TIME_60_NAME = "60天以上未使用";
    public static final String DULL_STORAGE_TIME_90 = "90";
    public static final String DULL_STORAGE_TIME_90_NAME = "90天以上未使用";
    public static final String DULL_STORAGE_TIME_180 = "180";
    public static final String DULL_STORAGE_TIME_180_NAME = "180天以上未使用";
    
    public static final String STR_BALANCE_YES = "1" ;
    public static final String STR_NAME_BALANCE_YES = "已结算" ;
    public static final String STR_BALANCE_NO = "0" ;
    public static final String STR_NAME_BALANCE_NO = "未结算" ;
	
	// add by wing end
	
    // add by Jackey start
    
    public static final int INT_MAX = 1357904680;
        
    public static final String PRIX = "00";     //默认仓库通配值
    
    //迎世博600天车辆整治仓库代码
    public static final String[] WAREHOUSE_JT_CODE = new String[]{
        "01", "02", "03", "04", "05", "06", "07", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18"
    };
    public static Map initWorldExpWarehouse(){
        Map tp = new HashMap();
        
        tp.put("01", "巴士新新");
        tp.put("02", "巴士一汽");
        tp.put("03", "巴士四汽");
        tp.put("04", "巴士电车");
        tp.put("05", "浦东巴士");
        tp.put("06", "宝山巴士");
        tp.put("07", "上南巴士");
        tp.put("09", "大众西南");
        tp.put("10", "大众西北");
        tp.put("11", "大众巴士");
        tp.put("12", "大众百通");
        tp.put("13", "崇明大众");
        tp.put("14", "申新巴士");
        tp.put("15", "金山大众");
        tp.put("16", "奉贤大众");
        tp.put("17", "五汽公交");
        tp.put("18", "强生公交");
        
        return tp;
    }
    
    //迎世博600天车辆整治代码
    public static final String[] BILL_TYPE_CODE = new String[]{"01", "02", "03"};
    public static Map initWorldExpCode(){
        Map worldExpCode = new HashMap();
        
        worldExpCode.put("01", "发动机整治");
        worldExpCode.put("02", "外车身整治");
        worldExpCode.put("03", "内车身整治");
        
        return worldExpCode;
    }
    
    //迎世博600天车辆整治车型表
    public static final String[] BUS_TYPE = new String[]{
        "SWB6105系列", 
        "SWB6106系列",
        "SWB6100系列",
        "SWB6115系列",
        "SWB6120KHV系列",
        "SWB6116系列",
        "CNG车",
        "空调电车",
        "GDW6105G",
        "SXC6105G3",
        "SXC6120G3",
        "厦门金龙车",
        "苏州金龙车",
        "厦门金旅车",
        "吉江车",
        "黄海车",
        "中通车",
        "友谊车",
        "牡丹车",
        "太湖车",
        "萍乡车",
        "亚星车",
        "长江车",
        "扬子车",
        "其它"

    };
    public static Map initWorldExpBusType(){
        Map worldExpBusType = new HashMap();
        
        worldExpBusType.put("SWB6105系列", "上海申沃");
        worldExpBusType.put("SWB6106系列", "上海申沃");
        worldExpBusType.put("SWB6100系列", "上海申沃");
        worldExpBusType.put("SWB6115系列", "上海申沃");
        worldExpBusType.put("SWB6120KHV系列", "上海申沃");
        worldExpBusType.put("SWB6116系列", "上海申沃");
        worldExpBusType.put("CNG车", "上海申沃");
        worldExpBusType.put("空调电车", "上海申沃");
        worldExpBusType.put("GDW6105G", "桂林大宇");
        worldExpBusType.put("SXC6105G3", "万象大宇");
        worldExpBusType.put("SXC6120G3", "万象大宇");
        worldExpBusType.put("厦门金龙车", "厦门金龙");
        worldExpBusType.put("苏州金龙车", "苏州金龙");
        worldExpBusType.put("厦门金旅车", "厦门金旅");
        worldExpBusType.put("吉江车", "吉江");
        worldExpBusType.put("黄海车", "丹东黄海");
        worldExpBusType.put("中通车", "聊城中通");
        worldExpBusType.put("友谊车", "江苏友谊");
        worldExpBusType.put("牡丹车", "江苏牡丹");
        worldExpBusType.put("太湖车", "无锡太湖");
        worldExpBusType.put("萍乡车", "萍乡安源");
        worldExpBusType.put("亚星车", "扬州亚星");
        worldExpBusType.put("长江车", "南京依维柯");
        worldExpBusType.put("扬子车", "滁州扬子");
        worldExpBusType.put("其它", "其它");
        
        return worldExpBusType;
    }
    
    //总成件外修费用
    public static final String[] ZCJType = new String[]{
        "发动机外包",
        "电器空调外包",
        "水箱外包维修",
        "自修件费用",
        "公务车维修",
        "其他"
    };
    
    //其他费用
    public static final String[] OtherMoneyType = new String[]{
        "材料总费用",
        "集中采购",
        "网上采购",
        "自行采购",
        "申沃配件",
        "发动机外包",
        "电器空调外包",
        "水箱外包维修",
        "自修件费用",
        "公务车维修",
        "其他"
    };
    
    public static Map initOtherMoneyType(){
        Map map = new HashMap();
        
        map.put("材料总费用", "0");
        map.put("集中采购", "0");
        map.put("网上采购", "0");
        map.put("自行采购", "0");
        map.put("申沃配件", "0");
        map.put("发动机外包", "5");
        map.put("电器空调外包", "5");
        map.put("水箱外包维修", "5");
        map.put("自修件费用", "5");
        map.put("公务车维修", "5");
        map.put("其他", "5");
        
        return map;
    }
    
    //获取仓库编码通配符
    public static String getWildCard(String strCurrWareCode){
      String currWareCode = strCurrWareCode;
      try{
          if (currWareCode!= null){
              if (currWareCode.length()>PRIX.length())
              {
                  String temp = currWareCode.substring(currWareCode.length()-PRIX.length(),currWareCode.length());
                  while(temp.equals(PRIX)&&(currWareCode.length()>PRIX.length())){
                      currWareCode = currWareCode.substring(0,currWareCode.length()-PRIX.length());
                      temp = currWareCode.substring(currWareCode.length()-PRIX.length(),currWareCode.length());
                  } 
              }
          }   
          return currWareCode;
      }catch(Exception e){
          return "";
      }
    }
    
    //判断仓库是否在列表中S
    public static boolean IsCheckedOfWarehouseCode(String[] warehouseCodes,String warehouseCode) throws Exception
    {
        boolean checked = false;
        if(warehouseCodes != null) {
            for(int i=0;i<warehouseCodes.length;i++)
            {
                if (warehouseCodes[i].equals(warehouseCode)) return true;
            }
        }
        return checked;
    }    
    
    // add by Jackey end
    
    //根据标志判断结算模式，湖南返回“买断”，上海返回“压库”
    public static String getBalanceModeByFlag(){
        if(GSBaseConstants.PLANPRICE.equals("true")){
            return ConstDefine.STR_MD;
        }
        else{
            return ConstDefine.STR_YK;
        }
    }
}
